package tt.dz.appserver.dao.ext;


import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Repository;

import tt.dz.appserver.dao.base.BasisDao;
import tt.dz.appserver.entity.model.user.UserAttention;

@Repository
public class UserAttentionDao extends BasisDao<UserAttention>{

	
	/**
	 * 用户是否关注
	 * @param userId
	 * @param attenUserId
	 * @return
	 */
	@Caching(cacheable={
			@Cacheable(value="attention",key="#userId+#attenUserId")
	})
	public int userAttentionFlag(String userId, String attenUserId){
		
		return 1;
	}
	
	/**
	 * 关注用户
	 * @param userId
	 * @param attenUserId
	 * @return
	 */
	@Caching(evict={
			@CacheEvict(value="attention",key="#userId+#attenUserId")
	})
	public boolean addUserAttention(String userId, String attenUserId){
		
		return true;
	}
}
